package com.dylan.channel.v6;

import com.dylan.channel.v6.channel.Channel;
import com.dylan.channel.v6.future.ChannelFuture;
import com.dylan.channel.v6.future.ChannelPromise;


public abstract class MultiThreadEventLoopGroup extends MultiTreadEventExecutorGroup implements EventLoopGroup {

    public MultiThreadEventLoopGroup(int treads) {
        super(treads);
    }

    @Override
    protected abstract EventLoop newChild();

    @Override
    public EventLoop next() {
        return (EventLoop) super.next();
    }

    //这个方法是实现了EventLoopGroup接口中的同名方法
    public ChannelFuture register(Channel channel) {
        return this.next().register(channel);
    }

    public ChannelFuture register(ChannelPromise promise) {
        return this.next().register(promise);
    }
}
